T - the type of object to manage in the PriorityQueue.public class PrioritySet<T>
extends java.util.PriorityQueue<T>
| Modifier and Type | Field and Description |
|---|---|
private boolean |
addOverride
Boolean indicating if newer elements with a greater compare value
should replace others.
|
| Constructor and Description |
|---|
PrioritySet(boolean addOverride)
Public constructor for initializing a PrioritySet.
|
PrioritySet(java.util.Comparator<T> compare,
boolean addOverride)
Public constructor for initializing a PrioritySet.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T t)
Allows additions of items that already has a copy within the set
(determined by obj.equals(obj2) ) and their subsequent replacement if
they are of lesser value than the new object as determined by the
queue's comparator.
|
clear, comparator, contains, iterator, offer, peek, poll, remove, size, spliterator, toArray, toArraycontainsAll, isEmpty, removeAll, retainAll, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitprivate final boolean addOverride
public PrioritySet(boolean addOverride)
addOverride - a boolean indicating if new elements may override
older ones based on the comparator's value.public PrioritySet(java.util.Comparator<T> compare, boolean addOverride)
compare - the Comparator to use for queue ordering.addOverride - a boolean indicating if new elements may override
older ones based on the comparator's value.public boolean add(T t)